import { baseApi, baseApp } from '@/server/base'

export type CompletedParams = {
  id: string | number
  method: string[]
  method_other: string
  file_id: string[] | number[]
}

export default [
  /**
   * 设置已完成
   * @param params
   * @returns
   */
  {
    url: /\/apis\/api\/apk\/tasks\/complete\/$[0-9]*`/,
    type: 'post',
    response: () => {
      return {
        code: 200,
        data: {
          id: 20,
          mcr_id: 215,
          type: 'Jam',
          block: null,
          prod: 'C437_D202SL_EFUSE',
          location: '{"block":null,"x":"1","y":"6"}',
          machine: 'SUZAMDASLT114',
          short: 'ASLT114',
          contents: {
            id: '215',
            jam: 'No 4  Tester socket IC put jam',
            category: 'position',
            qty: '23',
            days: '1',
            rate: '1.92',
            goal: null,
            gth_goal: '1.92'
          },
          urgent: 1,
          tags: null,
          shift: 'B',
          start: '2023-02-22 07:00:00',
          week: 'WW:08',
          date: '2023-02-22',
          publish_by: 'test',
          publish_at: '2023-02-22 09:22:06',
          owner_id: '101323',
          owner: 'deng,xiaowei',
          transfer_owner: null,
          transfer_owner_id: null,
          transfer_apply_at: null,
          transferd_by: null,
          transfer_pid: null,
          state: 3,
          completed_at: '2023-02-22 16:41:50',
          jam_method:
            '["offset\\u8c03\\u6574shuttle\\u5438\\u4ea7\\u54c1X\\/Y","\\u68c0\\u67e5\\u5149\\u7ea4\\u653e\\u5927\\u5668\\u548csocket sensor\\u7ebf \\u662f\\u5426\\u6709\\u5e72\\u6270"]',
          jam_method_other: 'other_method',
          reject_img_id: null,
          cancel_at: null,
          cancel_reason_other: null,
          cancel_reason: null,
          cancel_state: null,
          cancel_img_id: null,
          reject_reason: null,
          canceled_at: null,
          canceled_by: null,
          score: 0,
          system_state: 2,
          accepted_at: '2023-02-22 16:23:18',
          created_at: '2023-02-22 09:22:06',
          updated_at: '2023-02-22 16:41:50',
          deleted_at: null,
          deleted_by: null,
          deleted_reason: null
        },
        msg: ''
      }
    }
  },
  /**
   * 设置已完成
   * @param params
   * @returns
   */
  {
    url: `${baseApi}/api/apk/tasks/completed`,
    type: 'get',
    response: () => {
      return {
        code: 200,
        data: [
          {
            hour: '07:00',
            lists: [
              {
                received_by: '441343',
                received_at: '2022-12-21 07:50:00',
                completed_by: '441343',
                completed_at: '2022-12-21 07:55:00',
                canceled_by: null,
                canceled_at: null,
                updated_at: '2022-12-21 07:50:00',
                cell: 'SUZAMDASLT110',
                machine: 'ASLT110',
                block: 'B2',
                type: 'JAM',
                prod: null,
                created_by: null,
                urgent: 1,
                tag: null,
                state: 3,
                created_at: '2022-12-21 07:40:00',
                start: '07:40',
                end: '07:50',
                id: 1
              }
            ]
          },
          {
            hour: '08:00',
            lists: []
          },
          {
            hour: '09:00',
            lists: []
          },
          {
            hour: '10:00',
            lists: []
          },
          {
            hour: '11:00',
            lists: []
          },
          {
            hour: '12:00',
            lists: []
          },
          {
            hour: '13:00',
            lists: []
          },
          {
            hour: '14:00',
            lists: []
          },
          {
            hour: '15:00',
            lists: []
          },
          {
            hour: '16:00',
            lists: []
          },
          {
            hour: '17:00',
            lists: []
          },
          {
            hour: '18:00',
            lists: []
          }
        ],
        msg: ''
      }
    }
  }
]
